<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('合同树选择')" />
</head>
<style>
	body{height:auto;font-family: "Microsoft YaHei";}
	button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
</style>
<body class="hold-transition box box-main">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 select-table table-striped">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								<p>合同编号：</p>
								<input type="text" name="contractNo"/>
							</li>
							<li>
								<p>合同名称：</p>
								<input type="text" name="contractName"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
				<input id="contractId" type="hidden"/>
				<input id="contractNo" type="hidden"/>
				<input id="contractName" type="hidden"/>
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
        var prefix = ctx + "system/contractDetail";
        $(function() {
            var options = {
                url: prefix + "/list",
                sortName: "contractId",
                sortOrder: "desc",
                modalName: "合同",
                escape: false,
                showPageGo: true,
                rememberSelected: true,
                mobileResponsive: false, //本弹窗宽度太小，系统默认显示cardview，所以要加上此属性，强制让他显示列表
                showRefresh: false,
				showSearch:false,
                showToggle: false,
                showColumns: false,
                columns: [{
                    field : 'contractId',
                    title : '合同id'
                },
				{
					field : 'contractNo',
					title : '合同编号'
				},
				{
                    field : 'contractName',
                    title : '合同名称'
				}],
                onClickRow: function(row, $element){
					$('#contractId').val(row.contractId);
					$('#contractNo').val(row.contractNo);
					$('#contractName').val(row.contractName);
                    $('.info').removeClass('info');//移除class
                    $($element).addClass('info');//添加class
				}
            };
            $.table.init(options);
        });
	</script>
</body>
</html>
